c program to find first and last digit of a number